package com.smile.service.entity.device.property;

import com.alibaba.fastjson2.annotation.JSONField;

import java.util.List;

public class DroneStatusData {

    /**
     * 负载编号
     */
    @JSONField(name = "52-0-0")
    private PayloadInfo payloadInfo; // 动态载荷信息（按实际字段名定义）

    /**
     * 机场激活时间(unix 时间戳)
     */
    @JSONField(name = "activation_time")
    private long activationTime;

    @JSONField(name = "attitude_head")
    private double attitudeHead;

    @JSONField(name = "attitude_pitch")
    private double attitudePitch;

    @JSONField(name = "attitude_roll")
    private double attitudeRoll;

    /**
     * 电池
     */
    @JSONField(name = "battery")
    private DroneBattery battery;

    @JSONField(name = "distance_limit_status")
    private DistanceLimitStatus distanceLimitStatus;

    @JSONField(name = "elevation")
    private int elevation;

    /**
     * 固件版本
     */
    @JSONField(name = "firmware_version")
    private String firmwareVersion;

    @JSONField(name = "gear")
    private int gear;

    /**
     * 椭球高度
     */
    @JSONField(name = "height")
    private double height;

    @JSONField(name = "height_limit")
    private int heightLimit;

    @JSONField(name = "home_distance")
    private int homeDistance;

    @JSONField(name = "horizontal_speed")
    private int horizontalSpeed;

    /**
     * 纬度
     */
    @JSONField(name = "latitude")
    private double latitude;

    /**
     * 经度
     */
    @JSONField(name = "longitude")
    private double longitude;

    /**
     * 保养信息
     */
    @JSONField(name = "maintain_status")
    private MaintainStatus maintainStatus;

    /**
     * 机场状态
     */
    @JSONField(name = "mode_code")
    private int modeCode;

    /**
     *
     */
    @JSONField(name = "night_lights_state")
    private int nightLightsState;

    @JSONField(name = "obstacle_avoidance")
    private ObstacleAvoidance obstacleAvoidance;

    /**
     * 搜星状态
     */
    @JSONField(name = "position_state")
    private PositionState positionState;

    /**
     * 存储容量
     */
    @JSONField(name = "storage")
    private StorageStatus storage;

    @JSONField(name = "total_flight_distance")
    private int totalFlightDistance;

    @JSONField(name = "total_flight_sorties")
    private int totalFlightSorties;

    @JSONField(name = "total_flight_time")
    private int totalFlightTime;

    @JSONField(name = "track_id")
    private String trackId;

    @JSONField(name = "vertical_speed")
    private int verticalSpeed;

    @JSONField(name = "wind_direction")
    private int windDirection;

    @JSONField(name = "wind_speed")
    private int windSpeed;

    // 嵌套类定义
    public static class PayloadInfo {
        @JSONField(name = "measure_target_altitude")
        private int measureTargetAltitude;

        @JSONField(name = "measure_target_distance")
        private double measureTargetDistance;

        @JSONField(name = "measure_target_error_state")
        private int measureTargetErrorState;

        @JSONField(name = "measure_target_latitude")
        private double measureTargetLatitude;

        @JSONField(name = "measure_target_longitude")
        private double measureTargetLongitude;

        @JSONField(name = "payload_index")
        private String payloadIndex;

        @JSONField(name = "version")
        private int version;

        // Getters & Setters
        public int getMeasureTargetAltitude() {
            return measureTargetAltitude;
        }

        public void setMeasureTargetAltitude(int measureTargetAltitude) {
            this.measureTargetAltitude = measureTargetAltitude;
        }

        public double getMeasureTargetDistance() {
            return measureTargetDistance;
        }

        public void setMeasureTargetDistance(double measureTargetDistance) {
            this.measureTargetDistance = measureTargetDistance;
        }

        public int getMeasureTargetErrorState() {
            return measureTargetErrorState;
        }

        public void setMeasureTargetErrorState(int measureTargetErrorState) {
            this.measureTargetErrorState = measureTargetErrorState;
        }

        public double getMeasureTargetLatitude() {
            return measureTargetLatitude;
        }

        public void setMeasureTargetLatitude(double measureTargetLatitude) {
            this.measureTargetLatitude = measureTargetLatitude;
        }

        public double getMeasureTargetLongitude() {
            return measureTargetLongitude;
        }

        public void setMeasureTargetLongitude(double measureTargetLongitude) {
            this.measureTargetLongitude = measureTargetLongitude;
        }

        public String getPayloadIndex() {
            return payloadIndex;
        }

        public void setPayloadIndex(String payloadIndex) {
            this.payloadIndex = payloadIndex;
        }

        public int getVersion() {
            return version;
        }

        public void setVersion(int version) {
            this.version = version;
        }

        @Override
        public String toString() {
            return "PayloadInfo{" +
                    "measureTargetAltitude=" + measureTargetAltitude +
                    ", measureTargetDistance=" + measureTargetDistance +
                    ", measureTargetErrorState=" + measureTargetErrorState +
                    ", measureTargetLatitude=" + measureTargetLatitude +
                    ", measureTargetLongitude=" + measureTargetLongitude +
                    ", payloadIndex='" + payloadIndex + '\'' +
                    ", version=" + version +
                    '}';
        }
    }

    public static class DroneBattery {
        @JSONField(name = "batteries")
        private List<Battery> batteries;

        @JSONField(name = "capacity_percent")
        private int capacityPercent;

        @JSONField(name = "landing_power")
        private int landingPower;

        @JSONField(name = "remain_flight_time")
        private int remainFlightTime;

        @JSONField(name = "return_home_power")
        private int returnHomePower;

        public static class Battery {
            @JSONField(name = "capacity_percent")
            private int capacityPercent;

            @JSONField(name = "firmware_version")
            private String firmwareVersion;

            @JSONField(name = "high_voltage_storage_days")
            private int highVoltageStorageDays;

            @JSONField(name = "index")
            private int index;

            @JSONField(name = "loop_times")
            private int loopTimes;

            @JSONField(name = "sn")
            private String sn;

            @JSONField(name = "sub_type")
            private int subType;

            @JSONField(name = "temperature")
            private double temperature;

            @JSONField(name = "type")
            private int type;

            @JSONField(name = "voltage")
            private int voltage;

            // Getters & Setters
            public int getCapacityPercent() {
                return capacityPercent;
            }

            public void setCapacityPercent(int capacityPercent) {
                this.capacityPercent = capacityPercent;
            }

            public String getFirmwareVersion() {
                return firmwareVersion;
            }

            public void setFirmwareVersion(String firmwareVersion) {
                this.firmwareVersion = firmwareVersion;
            }

            public int getHighVoltageStorageDays() {
                return highVoltageStorageDays;
            }

            public void setHighVoltageStorageDays(int highVoltageStorageDays) {
                this.highVoltageStorageDays = highVoltageStorageDays;
            }

            public int getIndex() {
                return index;
            }

            public void setIndex(int index) {
                this.index = index;
            }

            public int getLoopTimes() {
                return loopTimes;
            }

            public void setLoopTimes(int loopTimes) {
                this.loopTimes = loopTimes;
            }

            public String getSn() {
                return sn;
            }

            public void setSn(String sn) {
                this.sn = sn;
            }

            public int getSubType() {
                return subType;
            }

            public void setSubType(int subType) {
                this.subType = subType;
            }

            public double getTemperature() {
                return temperature;
            }

            public void setTemperature(double temperature) {
                this.temperature = temperature;
            }

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }

            public int getVoltage() {
                return voltage;
            }

            public void setVoltage(int voltage) {
                this.voltage = voltage;
            }

            @Override
            public String toString() {
                return "Battery{" +
                        "capacityPercent=" + capacityPercent +
                        ", firmwareVersion='" + firmwareVersion + '\'' +
                        ", highVoltageStorageDays=" + highVoltageStorageDays +
                        ", index=" + index +
                        ", loopTimes=" + loopTimes +
                        ", sn='" + sn + '\'' +
                        ", subType=" + subType +
                        ", temperature=" + temperature +
                        ", type=" + type +
                        ", voltage=" + voltage +
                        '}';
            }
        }

        // Getters & Setters
        public List<Battery> getBatteries() {
            return batteries;
        }

        public void setBatteries(List<Battery> batteries) {
            this.batteries = batteries;
        }

        public int getCapacityPercent() {
            return capacityPercent;
        }

        public void setCapacityPercent(int capacityPercent) {
            this.capacityPercent = capacityPercent;
        }

        public int getLandingPower() {
            return landingPower;
        }

        public void setLandingPower(int landingPower) {
            this.landingPower = landingPower;
        }

        public int getRemainFlightTime() {
            return remainFlightTime;
        }

        public void setRemainFlightTime(int remainFlightTime) {
            this.remainFlightTime = remainFlightTime;
        }

        public int getReturnHomePower() {
            return returnHomePower;
        }

        public void setReturnHomePower(int returnHomePower) {
            this.returnHomePower = returnHomePower;
        }

        @Override
        public String toString() {
            return "DroneBattery{" +
                    "batteries=" + batteries +
                    ", capacityPercent=" + capacityPercent +
                    ", landingPower=" + landingPower +
                    ", remainFlightTime=" + remainFlightTime +
                    ", returnHomePower=" + returnHomePower +
                    '}';
        }
    }

    public static class DistanceLimitStatus {
        @JSONField(name = "distance_limit")
        private int distanceLimit;

        @JSONField(name = "state")
        private int state;

        // Getters & Setters
        public int getDistanceLimit() {
            return distanceLimit;
        }

        public void setDistanceLimit(int distanceLimit) {
            this.distanceLimit = distanceLimit;
        }

        public int getState() {
            return state;
        }

        public void setState(int state) {
            this.state = state;
        }

        @Override
        public String toString() {
            return "DistanceLimitStatus{" +
                    "distanceLimit=" + distanceLimit +
                    ", state=" + state +
                    '}';
        }
    }

    public static class MaintainStatus {
        @JSONField(name = "maintain_status_array")
        private List<MaintainStatusItem> maintainStatusArray;

        public static class MaintainStatusItem {
            @JSONField(name = "last_maintain_flight_time")
            private int lastMaintainFlightTime;

            @JSONField(name = "last_maintain_time")
            private int lastMaintainTime;

            @JSONField(name = "last_maintain_type")
            private int lastMaintainType;

            @JSONField(name = "state")
            private int state;

            // Getters & Setters
            public int getLastMaintainFlightTime() {
                return lastMaintainFlightTime;
            }

            public void setLastMaintainFlightTime(int lastMaintainFlightTime) {
                this.lastMaintainFlightTime = lastMaintainFlightTime;
            }

            public int getLastMaintainTime() {
                return lastMaintainTime;
            }

            public void setLastMaintainTime(int lastMaintainTime) {
                this.lastMaintainTime = lastMaintainTime;
            }

            public int getLastMaintainType() {
                return lastMaintainType;
            }

            public void setLastMaintainType(int lastMaintainType) {
                this.lastMaintainType = lastMaintainType;
            }

            public int getState() {
                return state;
            }

            public void setState(int state) {
                this.state = state;
            }

            @Override
            public String toString() {
                return "MaintainStatusItem{" +
                        "lastMaintainFlightTime=" + lastMaintainFlightTime +
                        ", lastMaintainTime=" + lastMaintainTime +
                        ", lastMaintainType=" + lastMaintainType +
                        ", state=" + state +
                        '}';
            }
        }

        // Getters & Setters
        public List<MaintainStatusItem> getMaintainStatusArray() {
            return maintainStatusArray;
        }

        public void setMaintainStatusArray(List<MaintainStatusItem> maintainStatusArray) {
            this.maintainStatusArray = maintainStatusArray;
        }

        @Override
        public String toString() {
            return "MaintainStatus{" +
                    "maintainStatusArray=" + maintainStatusArray +
                    '}';
        }
    }

    public static class ObstacleAvoidance {
        @JSONField(name = "downside")
        private int downside;

        @JSONField(name = "horizon")
        private int horizon;

        @JSONField(name = "upside")
        private int upside;

        // Getters & Setters
        public int getDownside() {
            return downside;
        }

        public void setDownside(int downside) {
            this.downside = downside;
        }

        public int getHorizon() {
            return horizon;
        }

        public void setHorizon(int horizon) {
            this.horizon = horizon;
        }

        public int getUpside() {
            return upside;
        }

        public void setUpside(int upside) {
            this.upside = upside;
        }

        @Override
        public String toString() {
            return "ObstacleAvoidance{" +
                    "downside=" + downside +
                    ", horizon=" + horizon +
                    ", upside=" + upside +
                    '}';
        }
    }

    public static class PositionState {
        @JSONField(name = "gps_number")
        private int gpsNumber;

        @JSONField(name = "is_fixed")
        private int isFixed;

        @JSONField(name = "quality")
        private int quality;

        @JSONField(name = "rtk_number")
        private int rtkNumber;

        // Getters & Setters
        public int getGpsNumber() {
            return gpsNumber;
        }

        public void setGpsNumber(int gpsNumber) {
            this.gpsNumber = gpsNumber;
        }

        public int getIsFixed() {
            return isFixed;
        }

        public void setIsFixed(int isFixed) {
            this.isFixed = isFixed;
        }

        public int getQuality() {
            return quality;
        }

        public void setQuality(int quality) {
            this.quality = quality;
        }

        public int getRtkNumber() {
            return rtkNumber;
        }

        public void setRtkNumber(int rtkNumber) {
            this.rtkNumber = rtkNumber;
        }

        @Override
        public String toString() {
            return "PositionState{" +
                    "gpsNumber=" + gpsNumber +
                    ", isFixed=" + isFixed +
                    ", quality=" + quality +
                    ", rtkNumber=" + rtkNumber +
                    '}';
        }
    }

    public static class StorageStatus {
        @JSONField(name = "total")
        private int total;

        @JSONField(name = "used")
        private int used;

        // Getters & Setters
        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getUsed() {
            return used;
        }

        public void setUsed(int used) {
            this.used = used;
        }

        @Override
        public String toString() {
            return "StorageStatus{" +
                    "total=" + total +
                    ", used=" + used +
                    '}';
        }
    }

    // Getters & Setters
    public PayloadInfo getPayloadInfo() {
        return payloadInfo;
    }

    public void setPayloadInfo(PayloadInfo payloadInfo) {
        this.payloadInfo = payloadInfo;
    }

    public long getActivationTime() {
        return activationTime;
    }

    public void setActivationTime(long activationTime) {
        this.activationTime = activationTime;
    }

    public double getAttitudeHead() {
        return attitudeHead;
    }

    public void setAttitudeHead(double attitudeHead) {
        this.attitudeHead = attitudeHead;
    }

    public double getAttitudePitch() {
        return attitudePitch;
    }

    public void setAttitudePitch(double attitudePitch) {
        this.attitudePitch = attitudePitch;
    }

    public double getAttitudeRoll() {
        return attitudeRoll;
    }

    public void setAttitudeRoll(double attitudeRoll) {
        this.attitudeRoll = attitudeRoll;
    }

    public DroneBattery getBattery() {
        return battery;
    }

    public void setBattery(DroneBattery battery) {
        this.battery = battery;
    }

    public DistanceLimitStatus getDistanceLimitStatus() {
        return distanceLimitStatus;
    }

    public void setDistanceLimitStatus(DistanceLimitStatus distanceLimitStatus) {
        this.distanceLimitStatus = distanceLimitStatus;
    }

    public int getElevation() {
        return elevation;
    }

    public void setElevation(int elevation) {
        this.elevation = elevation;
    }

    public String getFirmwareVersion() {
        return firmwareVersion;
    }

    public void setFirmwareVersion(String firmwareVersion) {
        this.firmwareVersion = firmwareVersion;
    }

    public int getGear() {
        return gear;
    }

    public void setGear(int gear) {
        this.gear = gear;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public int getHeightLimit() {
        return heightLimit;
    }

    public void setHeightLimit(int heightLimit) {
        this.heightLimit = heightLimit;
    }

    public int getHomeDistance() {
        return homeDistance;
    }

    public void setHomeDistance(int homeDistance) {
        this.homeDistance = homeDistance;
    }

    public int getHorizontalSpeed() {
        return horizontalSpeed;
    }

    public void setHorizontalSpeed(int horizontalSpeed) {
        this.horizontalSpeed = horizontalSpeed;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public MaintainStatus getMaintainStatus() {
        return maintainStatus;
    }

    public void setMaintainStatus(MaintainStatus maintainStatus) {
        this.maintainStatus = maintainStatus;
    }

    public int getModeCode() {
        return modeCode;
    }

    public void setModeCode(int modeCode) {
        this.modeCode = modeCode;
    }

    public int getNightLightsState() {
        return nightLightsState;
    }

    public void setNightLightsState(int nightLightsState) {
        this.nightLightsState = nightLightsState;
    }

    public ObstacleAvoidance getObstacleAvoidance() {
        return obstacleAvoidance;
    }

    public void setObstacleAvoidance(ObstacleAvoidance obstacleAvoidance) {
        this.obstacleAvoidance = obstacleAvoidance;
    }

    public PositionState getPositionState() {
        return positionState;
    }

    public void setPositionState(PositionState positionState) {
        this.positionState = positionState;
    }

    public StorageStatus getStorage() {
        return storage;
    }

    public void setStorage(StorageStatus storage) {
        this.storage = storage;
    }

    public int getTotalFlightDistance() {
        return totalFlightDistance;
    }

    public void setTotalFlightDistance(int totalFlightDistance) {
        this.totalFlightDistance = totalFlightDistance;
    }

    public int getTotalFlightSorties() {
        return totalFlightSorties;
    }

    public void setTotalFlightSorties(int totalFlightSorties) {
        this.totalFlightSorties = totalFlightSorties;
    }

    public int getTotalFlightTime() {
        return totalFlightTime;
    }

    public void setTotalFlightTime(int totalFlightTime) {
        this.totalFlightTime = totalFlightTime;
    }

    public String getTrackId() {
        return trackId;
    }

    public void setTrackId(String trackId) {
        this.trackId = trackId;
    }

    public int getVerticalSpeed() {
        return verticalSpeed;
    }

    public void setVerticalSpeed(int verticalSpeed) {
        this.verticalSpeed = verticalSpeed;
    }

    public int getWindDirection() {
        return windDirection;
    }

    public void setWindDirection(int windDirection) {
        this.windDirection = windDirection;
    }

    public int getWindSpeed() {
        return windSpeed;
    }

    public void setWindSpeed(int windSpeed) {
        this.windSpeed = windSpeed;
    }

    @Override
    public String toString() {
        return "DroneStatusData{" +
                "payloadInfo=" + payloadInfo +
                ", activationTime=" + activationTime +
                ", attitudeHead=" + attitudeHead +
                ", attitudePitch=" + attitudePitch +
                ", attitudeRoll=" + attitudeRoll +
                ", battery=" + battery +
                ", distanceLimitStatus=" + distanceLimitStatus +
                ", elevation=" + elevation +
                ", firmwareVersion='" + firmwareVersion + '\'' +
                ", gear=" + gear +
                ", height=" + height +
                ", heightLimit=" + heightLimit +
                ", homeDistance=" + homeDistance +
                ", horizontalSpeed=" + horizontalSpeed +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", maintainStatus=" + maintainStatus +
                ", modeCode=" + modeCode +
                ", nightLightsState=" + nightLightsState +
                ", obstacleAvoidance=" + obstacleAvoidance +
                ", positionState=" + positionState +
                ", storage=" + storage +
                ", totalFlightDistance=" + totalFlightDistance +
                ", totalFlightSorties=" + totalFlightSorties +
                ", totalFlightTime=" + totalFlightTime +
                ", trackId='" + trackId + '\'' +
                ", verticalSpeed=" + verticalSpeed +
                ", windDirection=" + windDirection +
                ", windSpeed=" + windSpeed +
                '}';
    }
}



